(function() {
  window.CPJSON = (function() {
    function CPJSON() {}

    CPJSON.prototype.getHTML = function(uri) {
      var response;
      response = null;
      $.ajax({
        dataType: 'html',
        crossDomain: true,
        url: uri,
        async: false,
        error: function(jqXHR, textStatus, errorThrown) {
          return $('body').append("AJAX Error: " + textStatus);
        },
        success: function(data, textStatus, jqXHR) {
          return response = data;
        }
      });
      return response;
    };

    CPJSON.prototype.getJSON = function(uri) {
      var response;
      response = null;
      $.ajax({
        dataType: 'json',
        crossDomain: true,
        url: uri,
        async: false,
        error: function(jqXHR, textStatus, errorThrown) {
          return $('body').append("AJAX Error: " + textStatus);
        },
        success: function(data, textStatus, jqXHR) {
          return response = data;
        }
      });
      return response;
    };

    return CPJSON;

  })();

}).call(this);
